
#include <BImage>
#include <BCamera>
#include "ClassCamera.h"

ClassCamera::ClassCamera() : BClass("Camera : public Node", true)
{
	this->insertMethod("void setCenter(real x, real y, real z);", &ClassCamera::setCenter_x_y_z);
	this->insertMethod("void setCenter(const Vector& center);", &ClassCamera::setCenter);
	this->insertMethod("const Vector& center() const;", &ClassCamera::center);

	this->insertMethod("void setUp(real x, real y, real z);", &ClassCamera::setUp_x_y_z);
	this->insertMethod("void setUp(const Vector& up);", &ClassCamera::setUp);
	this->insertMethod("const Vector& up() const;", &ClassCamera::up);

	this->insertMethod("void setOrtho(bool ortho);", &ClassCamera::setOrtho);
	this->insertMethod("bool ortho() const;", &ClassCamera::ortho);

	this->insertMethod("void setFovy(real fovy);", &ClassCamera::setFovy);
	this->insertMethod("real fovy() const;", &ClassCamera::fovy);

	this->insertMethod("void setNear(real near);", &ClassCamera::setNear);
	this->insertMethod("real near() const;", &ClassCamera::near);

	this->insertMethod("void setFar(real far);", &ClassCamera::setFar);
	this->insertMethod("real far() const;", &ClassCamera::far);

	this->insertMethod("void setSamples(int samples);", &ClassCamera::setSamples);
	this->insertMethod("int samples() const;", &ClassCamera::samples);

	this->insertMethod("void setLensWidth(real lensWidth);", &ClassCamera::setLensWidth);
	this->insertMethod("real lensWidth() const;", &ClassCamera::lensWidth);

	this->insertMethod("void setLensHeight(real lensHeight);", &ClassCamera::setLensHeight);
	this->insertMethod("real lensHeight() const;", &ClassCamera::lensHeight);

	this->insertMethod("void setPixelWidth(int pixelWidth);", &ClassCamera::setPixelWidth);
	this->insertMethod("int pixelWidth() const;", &ClassCamera::pixelWidth);

	this->insertMethod("void setPixelHeight(int pixelHeight);", &ClassCamera::setPixelHeight);
	this->insertMethod("int pixelHeight() const;", &ClassCamera::pixelHeight);

	this->insertMethod("void setPixelSize(int pixelWidth, int pixelHeight);", &ClassCamera::setPixelSize_width_height);
	this->insertMethod("void setPixelSize(const Size& pixelSize);", &ClassCamera::setPixelSize);
	this->insertMethod("const Size& pixelSize() const;", &ClassCamera::pixelSize);

	this->insertMethod("void setPixelSizePolicy(Policy sizePolicy);", &ClassCamera::setPixelSizePolicy);
	this->insertMethod("Policy pixelSizePolicy() const;", &ClassCamera::pixelSizePolicy);

	this->insertMethod("real unit(real dist) const;", &ClassCamera::unit_dist);
	this->insertMethod("real unit(const Vector& vertex) const;", &ClassCamera::unit_vertex);

	this->insertMethod("Vector lensVertex(const Vector& vertex) const;", &ClassCamera::lensVertex);
	this->insertMethod("Point pixelPoint(const Vector& vertex) const;", &ClassCamera::pixelPoint);

	this->insertMethod("void setColor(byte r, byte g, byte b, byte a = 255);", &ClassCamera::setColor_r_g_b_a);
	this->insertMethod("void setColor(const Color& color);", &ClassCamera::setColor);
	this->insertMethod("const Color& color() const;", &ClassCamera::color);

	this->insertMethod("const Frustum& frustum() const;", &ClassCamera::frustum);
	this->insertMethod("const Vector& direct() const;", &ClassCamera::direct);
	this->insertMethod("const Vector& right() const;", &ClassCamera::right);

	this->insertMethod("bool capture(Image* image);", &ClassCamera::capture_image);
	this->insertMethod("bool capture(Image* image, const Rect& rect);", &ClassCamera::capture_image_rect);

	this->insertMethod("void fresh();", &ClassCamera::fresh);
	this->insertMethod("Box flush() const;", &ClassCamera::flush);

}

void ClassCamera::setCenter_x_y_z(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BReal x = argv[1];
	BReal y = argv[2];
	BReal z = argv[3];
	camera->setCenter(x, y, z);
}
void ClassCamera::setCenter(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	const BVector& center = argv[1];
	camera->setCenter(center);
}
void ClassCamera::center(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->center();
}

void ClassCamera::setUp_x_y_z(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BReal x = argv[1];
	BReal y = argv[2];
	BReal z = argv[3];
	camera->setUp(x, y, z);
}
void ClassCamera::setUp(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	const BVector& up = argv[1];
	camera->setUp(up);
}
void ClassCamera::up(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->up();
}

void ClassCamera::setOrtho(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	bool ortho = argv[1];
	camera->setOrtho(ortho);
}
void ClassCamera::ortho(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->ortho();
}

void ClassCamera::setFovy(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BReal fovy = argv[1];
	camera->setFovy(fovy);
}
void ClassCamera::fovy(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->fovy();
}

void ClassCamera::setNear(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BReal near = argv[1];
	camera->setNear(near);
}
void ClassCamera::near(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->near();
}

void ClassCamera::setFar(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BReal far = argv[1];
	camera->setFar(far);
}
void ClassCamera::far(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->far();
}

void ClassCamera::setSamples(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	int samples = argv[1];
	camera->setSamples(samples);
}
void ClassCamera::samples(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->samples();
}

void ClassCamera::setLensWidth(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BReal lensWidth = argv[1];
	camera->setLensWidth(lensWidth);
}
void ClassCamera::lensWidth(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->lensWidth();
}

void ClassCamera::setLensHeight(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BReal lensHeight = argv[1];
	camera->setLensHeight(lensHeight);
}
void ClassCamera::lensHeight(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->lensHeight();
}

void ClassCamera::setPixelWidth(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	int pixelWidth = argv[1];
	camera->setPixelWidth(pixelWidth);
}
void ClassCamera::pixelWidth(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->pixelWidth();
}

void ClassCamera::setPixelHeight(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	int pixelHeight = argv[1];
	camera->setPixelHeight(pixelHeight);
}
void ClassCamera::pixelHeight(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->pixelWidth();
}

void ClassCamera::setPixelSize_width_height(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	int pixelWidth = argv[1];
	int pixelHeight = argv[2];
	camera->setPixelSize(pixelWidth, pixelHeight);
}
void ClassCamera::setPixelSize(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	const BSize& pixelSize = argv[1];
	camera->setPixelSize(pixelSize);
}
void ClassCamera::pixelSize(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->pixelSize();
}

void ClassCamera::setPixelSizePolicy(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	Policy sizePolicy = argv[1];
	camera->setPixelSizePolicy(sizePolicy);
}
void ClassCamera::pixelSizePolicy(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->pixelSizePolicy();
}

void ClassCamera::unit_dist(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BReal dist = argv[1];
	argv[0] = camera->unit(dist);
}
void ClassCamera::unit_vertex(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	const BVector& vertex = argv[1];
	argv[0] = camera->unit(vertex);
}

void ClassCamera::lensVertex(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	const BVector& vertex = argv[1];
	camera->lensVertex(vertex);
}
void ClassCamera::pixelPoint(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	const BVector& vertex = argv[1];
	camera->pixelPoint(vertex);
}

void ClassCamera::setColor_r_g_b_a(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BByte r = argv[1];
	BByte g = argv[2];
	BByte b = argv[3];
	BByte a = argv[4];
	camera->setColor(r, g, b, a);
}
void ClassCamera::setColor(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	const BColor& color = argv[1];
	camera->setColor(color);
}
void ClassCamera::color(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->color();
}

void ClassCamera::frustum(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->frustum();
}
void ClassCamera::direct(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->direct();
}
void ClassCamera::right(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	argv[0] = camera->right();
}

void ClassCamera::capture_image(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BImage* image = argv[1];
	camera->capture(image);
}
void ClassCamera::capture_image_rect(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	BImage* image = argv[1];
	const BRect& rect = argv[2];
	camera->capture(image);
}

void ClassCamera::fresh(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	camera->fresh();
}
void ClassCamera::flush(int argc, BValue* argv)
{
	BCamera* camera = argv[0];
	camera->flush();
}
